package com.sugon.service.impl;

import cn.hutool.core.util.RandomUtil;
import com.sugon.dao.DevStatusHistoryRecordDao;
import com.sugon.entity.DevStatusHistoryRecordEntity;
import com.sugon.service.DevStatusHistoryRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 设备状态历史记录表Service实现类
 *
 * @author sugon
 * @date 2020-12-23 11:42:55
 */
@Service("devStatusHistoryRecordService")
public class DevStatusHistoryRecordServiceImpl implements DevStatusHistoryRecordService {
    @Autowired
    private DevStatusHistoryRecordDao devStatusHistoryRecordDao;

    @Override
    public DevStatusHistoryRecordEntity queryObject(String id) {
        return devStatusHistoryRecordDao.queryObject(id);
    }

    @Override
    public List<DevStatusHistoryRecordEntity> queryList(Map<String, Object> map) {
        return devStatusHistoryRecordDao.queryList(map);
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return devStatusHistoryRecordDao.queryTotal(map);
    }

    @Override
    public int save(DevStatusHistoryRecordEntity devStatusHistoryRecord) {
        devStatusHistoryRecord.setId(RandomUtil.randomString(32));
        return devStatusHistoryRecordDao.save(devStatusHistoryRecord);
    }

    @Override
    public int update(DevStatusHistoryRecordEntity devStatusHistoryRecord) {
        return devStatusHistoryRecordDao.update(devStatusHistoryRecord);
    }

    @Override
    public int delete(String id) {
        return devStatusHistoryRecordDao.delete(id);
    }

    @Override
    public int deleteBatch(String[] ids) {
        return devStatusHistoryRecordDao.deleteBatch(ids);
    }
}
